/* 
 * File:   Memento.h
 * Author: Gab'z
 *
 * Created on 30 avril 2012, 20:32
 */

#ifndef MEMENTO_H
#define	MEMENTO_H
#include "Contexte.h"
#include "Parametres.h"
#include "Pile.h"
#include "model\UserCommand.h"

namespace calculatrice {

    namespace MODEL {

        class Memento {
        public:

            ~Memento() {
                //supprimer les 2 listes
                delete[] userCommands;
                delete[] piles;
            }
        private:
            Parametres parametres;
            UserCommand* userCommands;
            unsigned int nb_userCommands;
            Pile* piles;
            unsigned int nb_piles;

            friend class Contexte;

            Memento(const Contexte* c) :
            parametres(c->getParametres()),
            userCommands(new UserCommand[c->getUserCommands().size()]),
            nb_userCommands(c->getUserCommands().size()),
            piles(new Pile[c->getPiles().size()]),
            nb_piles(c->getPiles().size()) {
                //TODO copie des 2 listes à partir du contexte
                // piles
                // userCommands
            }

        };
    }
}

#endif	/* MEMENTO_H */

